package view 
{
	import flash.events.DataEvent;
	import salomon.loader.TextureLoader;
	import salomon.manager.TextureManager;
	import salomon.utils.Alert;
	import starling.display.Sprite;
	import starling.events.Event;
	import starling.display.MovieClip;
	import starling.textures.Texture;
	/**
	 * ...
	 * @author Tiago Salomon
	 */
	public class BackgroundView extends Sprite 
	{
		
		private var _texture:TextureLoader;
		private var tm:TextureManager;
		
		public function BackgroundView(tm:TextureManager) 
		{
			this.tm = tm;
			this.addEventListener(Event.ADDED_TO_STAGE, initialize);
		}
		
		private function initialize(e:Event):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, initialize);

			var vec:Vector.<Texture> = new Vector.<Texture>();
				vec.push(tm.getItem("Background").getTexture("BLUE_GRASS_BG_1"));
				
			Alert.to(tm.getItem("Background").getTexture("BLUE_GRASS_BG_1"));
				
			var movie:MovieClip = new MovieClip(vec, 0);
			
			this.addChild(movie);
		}
		
	}

}